Known as a conventional method of manufacturing an optical element is one pressing a forming mold against a resin material arranged within a depression in a base and curing the resin material, so as to form a formed layer provided with an optical function part such as a grating within the depression in the base (see, for example, Patent Literatures 1 to 5).